package com.roc.web.action;

import java.util.ArrayList;
import java.util.List;

import com.roc.page.BaseSearchCondition;
import com.roc.page.WhereHQLFieldBean;
import com.roc.util.Constance;

public class OrgSearchCondition  extends BaseSearchCondition{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String  insName;
	
	@Override
	protected List<WhereHQLFieldBean> getWhereHQLFieldBeanList() {
		List<WhereHQLFieldBean> filedBeanList = new ArrayList<WhereHQLFieldBean>();
		if (Constance.isNotEmpty(insName)) {
			filedBeanList.add(new WhereHQLFieldBean("t.ins_name", insName.trim(),
					"LIKE", false, "ALL"));
		}
		return filedBeanList;
	}

	@Override
	protected String getRowCountHQL() {
		String  sql=" select count(*) from tbl_ins_inf t where 1=1 ";
		return sql;
	}
	@Override
	protected String getSearchHQL() {
		String  sql=" select t.ins_id_cd,t.ins_type, t.ins_name, t.ins_prov_cd,  t.ins_city_cd,"
			       +" t.ins_sta, t.ins_stlm_tp, t.ins_alo_stlm_cycle,  t.ins_alo_stlm_md,"
			       +" t.ins_stlm_c_nm,t.ins_stlm_c_acct,t.ins_stlm_c_bk_no,t.ins_stlm_c_bk_nm,"
			       + " t.ins_stlm_d_nm, t.ins_stlm_d_acct, t.ins_stlm_d_bk_no, t.ins_stlm_d_bk_nm,"
			       + " t.rec_upd_opr,t.rec_crt_ts,t.rec_upd_ts "
			       + " from tbl_ins_inf t where 1=1 ";
		return sql;
	}

	@Override
	protected String getOrderPartOfHQL() {
		return " order by t.rec_crt_ts desc ";
	}
	
	public String getInsName() {
		return insName;
	}

	public void setInsName(String insName) {
		this.insName = insName;
	}
    
	
}
